package com.bw.a525zy.New

import androidx.lifecycle.viewModelScope
import androidx.paging.*
import com.bw.base.entity.NewEntityItem
import com.bw.base.mvvm.BaseViewModel
import com.bw.base.net.ApiServer
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.Flow
import java.lang.reflect.ParameterizedType
import javax.inject.Inject
@HiltViewModel
class NewViewModel @Inject constructor(val apiServer: ApiServer):BaseViewModel(){
    fun NewResUlt():Flow<PagingData<NewEntityItem>>{
      return Pager(config = PagingConfig(pageSize = 10), pagingSourceFactory = {
            NewSure(apiServer)
       }).flow.cachedIn(viewModelScope)
    }
}